import request from '@/utils/request'

// 出库详情
export function detailOutbounds(query) {
	return request({
		url: '/api/warehouses/products/outbounds/' + query.id,
		method: 'get'
	})
}

// 入库详情
export function detailInbounds(query) {
	return request({
		url: '/api/warehouses/products/inbounds/' + query.id,
		method: 'get'
	})
}

// 出库
export function outbounds(data) {
	return request({
		url: '/api/warehouses/products/outbounds',
		method: 'post',
		data
	})
}

// 入库
export function inbounds(data) {
	return request({
		url: '/api/warehouses/products/inbounds',
		method: 'post',
		data
	})
}

// 库存记录列表
export function listInventory(query) {
	return request({
		url: '/api/warehouses/products/stocks',
		method: 'get',
		params: query
	})
}


// 列表
export function list(query) {
	return request({
		url: '/api/warehouses/products',
		method: 'get',
		params: query
	})
}

// 新增
export function add(data) {
	return request({
		url: '/api/warehouses/products',
		method: 'post',
		data
	})
}

// 详情
export function detail(query) {
	return request({
		url: '/api/warehouses/products/' + query.id,
		method: 'get',
		params:query
	})
}

// 删除
export function remove(query) {
	return request({
		url: '/api/warehouses/products/' + query.id,
		method: 'delete'
	})
}